package com.hdd.biz.task;



import com.hdd.utils.wx.ActionRecordUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author ;xuhu
 * @Description:
 * @Date: 2020-11-06 14:36
 **/
@Component
@Configurable
@EnableScheduling
public class WxRecordActionTask {

    @Autowired
    private ActionRecordUtil actionRecordUtil;

//    @Autowired
//    private ActionRecordDao actionRecordDao;

    @Scheduled(cron = "0 59 23 * * ?")
    public void execute() {
        //分享到朋友圈
        long shareCircle = actionRecordUtil.resetRecordValue(ActionRecordUtil.WX_SHARE_CIRCLE);

        //分享到好友
        long shareFriend = actionRecordUtil.resetRecordValue(ActionRecordUtil.WX_SHARE_FRIEND);

        //点击赞赏按钮
        long clickReward = actionRecordUtil.resetRecordValue(ActionRecordUtil.WX_CLICK_REWARD);

//        ActionRecord actionRecord = new ActionRecord();
//        actionRecord.setClickRewardCount(clickReward);
//        actionRecord.setShareCircle(shareCircle);
//        actionRecord.setShareFriend(shareFriend);
//
//        actionRecord.preAdd();
//        actionRecordDao.save(actionRecord);
    }

}